﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;

namespace FaceSharp.Api.Common
{
    public static class JTokenUtil
    {
        public static DateTime? ParseDateTime(JToken jToken, string key)
        {
            DateTime? returnVal = null;
            DateTime tempVal;
            if (jToken[key] != null && DateTime.TryParse((string)jToken[key], out tempVal))
            {
                returnVal = tempVal;
            }
            return returnVal;
        }
    }
}
